// AnswerServerDlg.h : header file
//


#if !defined(AFX_ANSWERSERVERDLG_H__EDBBE00F_8089_4A43_9E9D_18E884FB293E__INCLUDED_)
#define AFX_ANSWERSERVERDLG_H__EDBBE00F_8089_4A43_9E9D_18E884FB293E__INCLUDED_

#include "ServerSocket.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iostream>
#include <map>
#include <string.h>
#include <vector>
#include <list>
#include <set>
#include <iterator>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <assert.h>
#include <functional>
#include <sstream>
#include "ConnectedSocket.h"

using namespace std;

/////////////////////////////////////////////////////////////////////////////
// CAnswerServerDlg dialog

class CAnswerServerDlg : public CDialog
{
// Construction
public:
	void OnCloseConnectedSocket(CConnectedSocket *p);
	void OnReceive(CConnectedSocket *p);
	void OnAcceptClientConnect(CConnectedSocket *p);
	CAnswerServerDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CAnswerServerDlg)
	enum { IDD = IDD_ANSWERSERVER_DIALOG };
	CStatic	m_Pic;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAnswerServerDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CAnswerServerDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnDestroy();
	afx_msg void OnButtonAnswer1();
	afx_msg void OnButtonAnswer2();
	afx_msg void OnButtonAnswer3();
	afx_msg void OnButtonAnswer4();
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	UINT	m_port;
	CString m_strPicPath;
	void Answer(int index);
	void ShowReceivePic(CString name);
	void ShowReceivePic(CConnectedSocket *p);
	CServerSocket m_ServerSocket;
    vector<CConnectedSocket *> m_Connects;
	CConnectedSocket	*m_pShowing;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ANSWERSERVERDLG_H__EDBBE00F_8089_4A43_9E9D_18E884FB293E__INCLUDED_)
